//
//  ShopNetTool.m
//  ShopNet
//
//  Created by chenguibang on 17/3/3.
//  Copyright © 2017年 chenguibang. All rights reserved.
//

#import "ShopNetTool.h"
#import <AFNetworking/AFNetworking.h>
#import "AopManager.h"
#import <AFNetworking/AFNetworkActivityIndicatorManager.h>
@implementation ShopNetTool
+(id)tool{
    static dispatch_once_t onceToken;
    static ShopNetTool *shared = nil;
    dispatch_once(&onceToken, ^{
        shared = [ShopNetTool manager];
        [AFNetworkActivityIndicatorManager sharedManager].enabled = YES;
        
        shared.operationQueue.maxConcurrentOperationCount = 10;
        shared.requestSerializer = [AFHTTPRequestSerializer serializer];
        [shared.requestSerializer setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
        
        shared.responseSerializer = [AFHTTPResponseSerializer serializer];
        shared.responseSerializer.acceptableContentTypes = [NSSet setWithArray:@[@"application/json",
                                                                                   @"text/html",
                                                                                   @"text/json",
                                                                                   @"text/plain",
                                                                                   @"text/javascript",
                                                                                   @"text/xml",
                                                                                   @"application/x-www-form-urlencoded",
                                                                                   @"image/*"]];
        

        [AopManager setupLog:YES];
    });
    return shared;
}


@end
